﻿using NovoUSB2XXX;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NovoSerDes.Comm
{
    public interface INovoComm
    {
        Int32 Novo_CreateSdk();
        void Novo_DeleteSdk();
        Int32 Novo_InitDev(ref NOVO_DEV_CONFIG pDevCfg);
        Int32 Novo_EnumDevice();
        Int32 Novo_SetDeviceId(int devID);
        Int32 Novo_OpenDevice();
        Int32 Novo_CloseDevice();
        Int32 Novo_GetDevInfo(ref NOVO_DEV_INFO pDevInfo);
        void Novo_GetDevName(StringBuilder devName);

        Int32 Novo_IIC_Init(ref NOVO_IIC_CONFIG I2CConfig);
        Int32 Novo_IIC_SetIndex(int IICIndex);
        Int32 Novo_IIC_ScanDevAddr(byte[] pSlaveAddr);
        Int32 Novo_IIC_RW_U8_Basic(byte devAddr, byte[] pWriteData, int writeLen, byte[] pReadData, int readLen);
        Int32 Novo_IIC_Wr_U8(byte devAddr, byte regAddr, byte regData);
        Int32 Novo_IIC_Wr_U16(byte devAddr, UInt16 regAddr, UInt16 regData);
        Int32 Novo_IIC_Wr_U32(byte devAddr, UInt32 regAddr, UInt32 regData);
        Int32 Novo_IIC_Wr_U16U8(byte devAddr, UInt16 regAddr, byte regData);
        Int32 Novo_IIC_Wr_U16U32(byte devAddr, UInt16 regAddr, UInt32 regData);
        Int32 Novo_IIC_Rd_U8(byte devAddr, byte regAddr, ref byte pRegData);
        Int32 Novo_IIC_Rd_U16(byte devAddr, UInt16 regAddr, ref UInt16 pRegData);
        Int32 Novo_IIC_Rd_U32(byte devAddr, UInt32 regAddr, ref UInt32 pRegData);
        Int32 Novo_IIC_Rd_U16U8(byte devAddr, UInt16 regAddr, ref byte pRegData);
        Int32 Novo_IIC_Rd_U16U32(byte devAddr, UInt16 regAddr, ref UInt32 pRegData);

        Int32 Novo_GPIO_Get(byte mask, ref byte pData);
        Int32 Novo_GPIO_Set(byte mask, byte data);
    }
}
